package com.gitee.qdbp.general.common.api.reusable.service;

import java.util.List;
import com.gitee.qdbp.able.exception.ServiceException;
import com.gitee.qdbp.able.jdbc.ordering.OrderPaging;
import com.gitee.qdbp.able.jdbc.paging.PageList;
import com.gitee.qdbp.general.common.api.reusable.model.SimpleTreeBean;
import com.gitee.qdbp.general.common.api.reusable.model.SimpleTreeCode;
import com.gitee.qdbp.general.common.api.reusable.model.SimpleTreeWhere;

/**
 * 基础树形数据业务接口
 *
 * @author zhh
 * @version 180514
 */
public interface ISimpleTreeQueryer {

    int CATEGORY_CODE_LENGTH = 5;

    /** 查询节点详情 **/
    SimpleTreeBean find(SimpleTreeCode model) throws ServiceException;

    /** 查询节点列表 **/
    PageList<SimpleTreeBean> list(String scene, SimpleTreeWhere where, OrderPaging paging) throws ServiceException;

    /** 查询节点列表, parents=是否查询父节点 **/
    List<SimpleTreeBean> list(String scene, List<String> nodeCodes, boolean parents) throws ServiceException;

    /** 查询父节点列表, self=是否包含自身 **/
    List<SimpleTreeBean> parents(String scene, String nodeCode, boolean self) throws ServiceException;

    /** 查询子节点列表 **/
    PageList<SimpleTreeBean> children(String scene, String nodeCode, OrderPaging paging) throws ServiceException;

    /** 查询所有后代节点列表 **/
    PageList<SimpleTreeBean> descendants(String scene, String nodeCode, OrderPaging paging) throws ServiceException;

}
